<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id 
 * @property string $name 
 * @property int $aid 
 * @property int $page_count 
 */
class BilibiliVideo extends Model
{

    protected $table = 'bilibili_videos';

    protected $fillable = ['aid','pic','title','desc'];

    protected $casts = ['id' => 'integer', 'aid' => 'string', 'page_count' => 'integer'];

    public function pages()
    {
        return $this->hasMany(BilibiliVideoPage::class,'aid','aid');
    }


    public function getPicAttribute($value)
    {
        return env('APP_URL').'/'.$value;
    }

}